package com.czh.subject.infra.basic.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.czh.subject.infra.basic.entity.SubjectLabel;
import com.czh.subject.infra.basic.mapper.SubjectLabelMapper;
import com.czh.subject.infra.basic.service.SubjectLabelService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 题目标签表(SubjectLabel)表服务实现类
 *
 * @author caozaihui
 * @since 2024-07-30 14:50:20
 */
@Service("subjectLabelService")
@RequiredArgsConstructor
public class SubjectLabelServiceImpl extends ServiceImpl<SubjectLabelMapper, SubjectLabel> implements SubjectLabelService {

        /** 
         * 
         * @param  id 主键
         * @author caozaihui  
         * @description //TODO  通过ID查询单条数据
         * @date 2024-07-30 14:50:20
         * @return 实例对象
         */
        @Override
        public SubjectLabel selectSubjectLabelById (Long id) {
            return baseMapper.selectById(id);
        }


    /**
         * 
         * @param subjectLabel 实例对象
         * @author caozaihui  
         * @description //TODO  新增数据
         * @date 2024-07-30 14:50:20
         * @return 实例对象
         */
        @Override
        public int insert(SubjectLabel subjectLabel) {
               return baseMapper.insert(subjectLabel);
        }
        
        
        /** 
         * 
         * @param subjectLabel 实例对象
         * @author caozaihui  
         * @description //TODO  修改数据并返回
         * @date 2024-07-30 14:50:20
         * @return 实例对象
         */
        @Override
        public int update(SubjectLabel subjectLabel) {
            return baseMapper.updateById(subjectLabel);
        }
        
        
        /**
         *
         * @param idList 主键
         * @author caozaihui 
         * @description //TODO    通过主键删除数据
         * @date 2024-07-30 14:50:20
         * @return
         */
        @Override
        public int deleteByIds(List<Long> idList) {
            return baseMapper.deleteByIds(idList);
        }

        @Override
        public int deleteById(SubjectLabel subjectLabel) {
                return baseMapper.deleteById(subjectLabel);
        }



        @Override
        public List<SubjectLabel> selectByIds(List<Long> labelIds) {
            return baseMapper.selectByIds(labelIds);
        }

        @Override
        public List<SubjectLabel> queryByPrimaryCategoryId(SubjectLabel subjectLabel) {
            return baseMapper.selectSubjectLabelList(subjectLabel);
        }

        @Override
        public List<SubjectLabel> batchQueryByCategoryId(List<Long> labelIdList) {
            return baseMapper.selectByIds(labelIdList);
        }
}

